<%@ page
	import="java.io.*,java.util.*,java.sql.*,javax.sql.*,javax.naming.*"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>DataSourse Connection Test</title>
</head>
<body>
<%
	try {
		java.sql.Connection con;
		Statement stmt;
		ResultSet rs;
		Context ctx = new InitialContext();
		DataSource ds = (DataSource) ctx
				.lookup("java:comp/env/jdbc/spa");
		con = ds.getConnection();

		stmt = con.createStatement();
		rs = stmt.executeQuery("select * from T_USER_GROUP");
		while (rs.next()) {
			out.print(rs.getString(1));
			out.print(rs.getString(2));
		}
		rs.close();
		stmt.close();
		con.close();

	} catch (Exception e) {
		out.print(e.getMessage());
	}
%>
</body>
</html>

